UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XhFBeStlBrmKyiMGgaUmBLVwBuFt+K4ApiRkwaSJcdE='
WHERE
key_id = '532946e0ad5f58c112bad9be9b3f06770c6ddf5c64a23e343b67840938543926'
AND (
token = 'XhFBeStlBrmKyiMGgaUmBLVwBuFt+K4ApiRkwaSJcdE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)