UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EDqM13I9IMLGWZ74sWIkK+hdrIQB1x2WY34SaKYqX6s='
WHERE
key_id = '4d6c9b6c290c3ef9f965f6590425f820ef8cd74fd94ba52fffcb4642ce9174d6'
AND (
token = 'EDqM13I9IMLGWZ74sWIkK+hdrIQB1x2WY34SaKYqX6s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)