UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JePrW/auPR8sARQxeIfmdz8JKAcaJghJ28JleTSBKXc=' 
WHERE 
  key_id = '1a7aa0cdacaa25f80b478544028cf453b121d42443a6b88deadf6aa7487268e0' 
  AND (
    token = 'JePrW/auPR8sARQxeIfmdz8JKAcaJghJ28JleTSBKXc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021