UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'esvGRzofNJBGZawRzmRV9gWussU4JnbRctMWbCZgY68=' 
WHERE 
  key_id = '930bd87c9d900de755015d1c60868e43ba1d6fdc824442df25a1cab6ac499d1a' 
  AND (
    token = 'esvGRzofNJBGZawRzmRV9gWussU4JnbRctMWbCZgY68=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029