UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kH7tyxt2ts1PVXSv0E6TEmOeHbxWXsBii4Kds6Ys2aM='
WHERE
key_id = '7ef4daca39a9ad5268fa1cc920bf53dbda240254e5ffcb01213194c68eaf4cdb'
AND (
token = 'kH7tyxt2ts1PVXSv0E6TEmOeHbxWXsBii4Kds6Ys2aM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)