UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iJG4+FnZQFIhOJJWkyayijBPQqZCLNfr/KzkYI3WKew=' 
WHERE 
  key_id = 'a633deadc2e6e9b2a7f3e0d4fc68fb2d32809a070a379d479ca991ec8a28dd55' 
  AND (
    token = 'iJG4+FnZQFIhOJJWkyayijBPQqZCLNfr/KzkYI3WKew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034