UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1d+YOY5JRv9VaNMVZ/bpgICkMnV4XCQl0T7PjXtAuNk='
WHERE
key_id = 'd1420d69973998953bbce8e6d6ea46daa0da3d678aa4c9480a1cbbac0827748a'
AND (
token = '1d+YOY5JRv9VaNMVZ/bpgICkMnV4XCQl0T7PjXtAuNk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)