UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'baNbKUCRG8JLAkIY93cbjDoJwOuhzeyJS3sVj38UvtI='
WHERE
key_id = '755ea7b4fcae73ea0c4060acc3ef40c069e751e2762b9b29c4dd8c320d304c98'
AND (
token = 'baNbKUCRG8JLAkIY93cbjDoJwOuhzeyJS3sVj38UvtI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)