UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0rVFsrOa172gq6OSBeQ1oB0Rpt058Vx5zgc0UmMxaxc=' 
WHERE 
  key_id = 'cc75f4406ef2310ccea7e136d679f463caae6b6d1db1a2366f4a12ef10d067c5' 
  AND (
    token = '0rVFsrOa172gq6OSBeQ1oB0Rpt058Vx5zgc0UmMxaxc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035