UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lLvReBPDsRL4nICCohCi6qabQyppHV48TB0gjQLQ9Dg='
WHERE
key_id = 'b8a05348af487ae44ed317db1e50d197678d9e179cf5700932663bb766149d26'
AND (
token = 'lLvReBPDsRL4nICCohCi6qabQyppHV48TB0gjQLQ9Dg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)