UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I2L64bZf5wqYWWPbAIG5rM26np9y9QkLSfRKc2YgJw0='
WHERE
key_id = '53ba32e2b9faadec635b54b6044e7172677bd9685ad360c275ea45c245afe55e'
AND (
token = 'I2L64bZf5wqYWWPbAIG5rM26np9y9QkLSfRKc2YgJw0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)