UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/jL9RN1fE+qcKEOFxKENZQDW4Y9iK1vB8SPOzpZPtm4='
WHERE
key_id = '1c3a33579f69c7f3b352d05bcd025cc4b5f8eaff71381c57067125a792af1c49'
AND (
token = '/jL9RN1fE+qcKEOFxKENZQDW4Y9iK1vB8SPOzpZPtm4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)