UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0VRitbn2V5foNqQYyUyZeJQ5tpRUBgyCuQ5F+o4mrOY='
WHERE
key_id = 'c0522d7c4998602c92a8bcb01ffcf3cfeb99035f9f82e68a36cdc704c6da5188'
AND (
token = '0VRitbn2V5foNqQYyUyZeJQ5tpRUBgyCuQ5F+o4mrOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)