UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wKUg5nRFgDSkH6oa5fV1drA30fiGmiD5efkPehJyjTg=' 
WHERE 
  key_id = 'ae4e1b6a6b898ff232c2e8b279f49f4a5ac2f405ef51eaddff3daf1632009d85' 
  AND (
    token = 'wKUg5nRFgDSkH6oa5fV1drA30fiGmiD5efkPehJyjTg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037