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