UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jlMoqHERhg8WYl4aC3uE930k7KMTFb+sXosM6MyqcYY='
WHERE
key_id = 'da3f3855b4f8764fb859c0c1089d72ac4f84ccd254f3b2ca064f939bd6d2b80b'
AND (
token = 'jlMoqHERhg8WYl4aC3uE930k7KMTFb+sXosM6MyqcYY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)