UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i4EwTs+BzgHMPSfWMdfk8fZcpEPa5+HY9SkGpA4xYFA='
WHERE
key_id = '39ef802ef38608d8feeafd074d7176a4c13ebf08dc4132327f5e23278cf50395'
AND (
token = 'i4EwTs+BzgHMPSfWMdfk8fZcpEPa5+HY9SkGpA4xYFA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)