UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0nE2JYadkpdNHxo5MdAnYJoIUW2EY0ArfbzR6wQhNk0='
WHERE
key_id = '95afdc00784685fc2ec6eae293b8dcf0c5fd3678ec73ecfba28d75ea301aa205'
AND (
token = '0nE2JYadkpdNHxo5MdAnYJoIUW2EY0ArfbzR6wQhNk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)