UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c/irODahfBuCHS6nzUJQjscuUHJXn3aTfYuFAT72Ir4='
WHERE
key_id = '1b92e1e7a860ebc5c66d0ba03f9dbccf4bfa537ae119a1746ee8ed47237b8d03'
AND (
token = 'c/irODahfBuCHS6nzUJQjscuUHJXn3aTfYuFAT72Ir4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)