UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ra+mKnpQ+qI79J1eJKcP51VquNwHbADWVtQy635q3FE='
WHERE
key_id = 'c705ddba002a5e728fcec99ae80afa062f6d082c413e0d1b6b1601f9bcbcd721'
AND (
token = 'ra+mKnpQ+qI79J1eJKcP51VquNwHbADWVtQy635q3FE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)