UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SLvNTWgTofwOQJkHDBypEBMwkDytbrNkeOGPj1Htanw='
WHERE
key_id = 'b40383ede638ec9b84072ae22eff7ff538468767ba69626e21f0275c597d3246'
AND (
token = 'SLvNTWgTofwOQJkHDBypEBMwkDytbrNkeOGPj1Htanw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)