UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nYYNSC0lBDjTZcpFfXXaaDBBGTTlBjXSX6V28JxkPLc=' 
WHERE 
  key_id = '7277eaf43c95bd1803457ac00d18a2289c7e9d322c4558b42210423e585c6d84' 
  AND (
    token = 'nYYNSC0lBDjTZcpFfXXaaDBBGTTlBjXSX6V28JxkPLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021