UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aKreuTFKEp7W2giVHib6roNxiBLOk9ZxPolZaa0Q7S8=' 
WHERE 
  key_id = '2c7b4cbd5247bd53fef297a47b2372dd56d90e61dd2402ff5dcd7dd3c625afd5' 
  AND (
    token = 'aKreuTFKEp7W2giVHib6roNxiBLOk9ZxPolZaa0Q7S8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027