UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JWOWSqYQwhzMKMPzNeMS/4ElcfBIv5c5mT2dC5NE+UE='
WHERE
key_id = '72b483ff89433e5b47254c238a2c8039ac7f70256ac8643c7c7c3c7297ec930c'
AND (
token = 'JWOWSqYQwhzMKMPzNeMS/4ElcfBIv5c5mT2dC5NE+UE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)