UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UMcWguCW4SvE2IchXftPAggp+2WeG2TTFinYUOmKHRI='
WHERE
key_id = 'f1bf55d1d2bdc657abc16c035725dceef13290e34dea54a0e79e8abb4d6866e2'
AND (
token = 'UMcWguCW4SvE2IchXftPAggp+2WeG2TTFinYUOmKHRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)