UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eowIA+JHug/p2xhnd+k7v9GRh1hmqXxLZv6YvxZgFHI='
WHERE
key_id = 'fd4e71938c2c691de37a517cd7aeeec458b90018875c870a588ca38d4fba7f64'
AND (
token = 'eowIA+JHug/p2xhnd+k7v9GRh1hmqXxLZv6YvxZgFHI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)