UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZJLbt0P/dSCGzfVM927OUsrH5jsLZwBimPyjqaEfJdY=' 
WHERE 
  key_id = '099720f9cf9585640f4510bda3ff3aade22a962d0bb27f0b9273b62409fb2eb4' 
  AND (
    token = 'ZJLbt0P/dSCGzfVM927OUsrH5jsLZwBimPyjqaEfJdY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029