UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jxZiWkPFDVJy2qc+NiPjExe6VCEzCTDFG5vnZ8O/Gsg=' 
WHERE 
  key_id = '73de0f2c57c2d0888fb343e6465b4fffbc4e875ef2b890c63c5c31694b6d0567' 
  AND (
    token = 'jxZiWkPFDVJy2qc+NiPjExe6VCEzCTDFG5vnZ8O/Gsg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033