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

Query time 0.00049