UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'errRPxAyaKBWDLIw8uNMEd/cISQu4N6P9qDQDThKoMQ=' 
WHERE 
  key_id = '4da6cd9e8701a125361dab5284345e38f73184ddf49ec85196f42bd8cbc3247e' 
  AND (
    token = 'errRPxAyaKBWDLIw8uNMEd/cISQu4N6P9qDQDThKoMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043