UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oWWhzfsOVC9gPJz3DJoadHZ52NaxcnBGp4y51iKu1ww='
WHERE
key_id = '637fab381ae467c689645a7b0dda84563f1e6db4ad71e372eac4d478afd6f96b'
AND (
token = 'oWWhzfsOVC9gPJz3DJoadHZ52NaxcnBGp4y51iKu1ww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)