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