UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ELCw5lTiKXMuBaDKbH+nIC5qS+Bfy3EM8z0rnhSV01E=' 
WHERE 
  key_id = '832e5f233fb83bbbc86749e56a356f969bc5b87fccc9b623d8c460c67e16a2fe' 
  AND (
    token = 'ELCw5lTiKXMuBaDKbH+nIC5qS+Bfy3EM8z0rnhSV01E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029