UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8/0etJ0Ewm861bFTIb3yq/9mU7SwOTddcoUFcDrMjeM='
WHERE
key_id = 'bc30d7cccd7f0efd0af264f5b0cef13f6ddcf864ceca23c43a760913ea9e06e0'
AND (
token = '8/0etJ0Ewm861bFTIb3yq/9mU7SwOTddcoUFcDrMjeM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)