UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WJZSU+RNCTociEEkmDJafSAmFZNQQSr7QR/ExDlrjU0=' 
WHERE 
  key_id = '43dbbb86a957b6955b9e9f3872a525f5c514024a374b43fb63db17122879188e' 
  AND (
    token = 'WJZSU+RNCTociEEkmDJafSAmFZNQQSr7QR/ExDlrjU0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045