UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vbiHkLt14bEOxtlBhwk9AS3eqwkJeIlYnKZGUmndTI8=' 
WHERE 
  key_id = '614e81fe927a92ea38a5fdca28899b63860230c59329bec592b1fd62697be720' 
  AND (
    token = 'vbiHkLt14bEOxtlBhwk9AS3eqwkJeIlYnKZGUmndTI8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058